renamed test_pixels to num_test_pixels.
authorSven Neumann <sven@gimp.org>
Tue, 19 Feb 2008 13:01:25 +0000 (13:01 +0000)
committerSven Neumann <neo@src.gnome.org>
Tue, 19 Feb 2008 13:01:25 +0000 (13:01 +0000)
2008-02-19  Sven Neumann  <sven@gimp.org>

* babl/babl-fish-path.c: renamed test_pixels to num_test_pixels.

svn path=/trunk/; revision=281

ChangeLog
babl/babl-fish-path.c

index f6d33a2e21bb3f9730453b2dbcdf8404b306d30d..a6e6afaba097d4dce9bf702734de48325edea7cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-19  Sven Neumann  <sven@gimp.org>
+
+       * babl/babl-fish-path.c: renamed test_pixels to num_test_pixels.
+
 2008-02-19  Sven Neumann  <sven@gimp.org>
 
        * babl/babl-fish-path.c (test_create): reverted previous change as
index 666c38bcb48c298e94c973431bbf9af238ac2f27..6fd18f195eddac0be54411241ca057d12ff142b0 100644 (file)
@@ -424,7 +424,7 @@ babl_fish_path_process (Babl *babl,
 }
 
 
-#define test_pixels    128
+#define num_test_pixels  128
 
 static double *
 test_create (void)
@@ -434,9 +434,9 @@ test_create (void)
 
   srandom (20050728);
 
-  test = babl_malloc (sizeof (double) * test_pixels * 4);
+  test = babl_malloc (sizeof (double) * num_test_pixels * 4);
 
-  for (i = 0; i < test_pixels * 4; i++)
+  for (i = 0; i < num_test_pixels * 4; i++)
     test [i] = (double) random () / RAND_MAX;
 
   return test;
@@ -466,49 +466,56 @@ chain_error (const Babl      *fmt_source,
   void   *ref_destination;
   double *ref_destination_rgba_double;
 
-  Babl   *fish_rgba_to_source      = babl_fish_reference (fmt_rgba_double, fmt_source);
-  Babl   *fish_reference           = babl_fish_reference (fmt_source, fmt_destination);
-  Babl   *fish_destination_to_rgba = babl_fish_reference (fmt_destination, fmt_rgba_double);
+  Babl   *fish_rgba_to_source      = babl_fish_reference (fmt_rgba_double,
+                                                          fmt_source);
+  Babl   *fish_reference           = babl_fish_reference (fmt_source,
+                                                          fmt_destination);
+  Babl   *fish_destination_to_rgba = babl_fish_reference (fmt_destination,
+                                                          fmt_rgba_double);
 
   test = test_create ();
 
-
-  source                      = babl_calloc (test_pixels, fmt_source->format.bytes_per_pixel);
-  destination                 = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
-  ref_destination             = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
-  destination_rgba_double     = babl_calloc (test_pixels, fmt_rgba_double->format.bytes_per_pixel);
-  ref_destination_rgba_double = babl_calloc (test_pixels, fmt_rgba_double->format.bytes_per_pixel);
+  source                      = babl_calloc (num_test_pixels,
+                                             fmt_source->format.bytes_per_pixel);
+  destination                 = babl_calloc (num_test_pixels,
+                                             fmt_destination->format.bytes_per_pixel);
+  ref_destination             = babl_calloc (num_test_pixels,
+                                             fmt_destination->format.bytes_per_pixel);
+  destination_rgba_double     = babl_calloc (num_test_pixels,
+                                             fmt_rgba_double->format.bytes_per_pixel);
+  ref_destination_rgba_double = babl_calloc (num_test_pixels,
+                                             fmt_rgba_double->format.bytes_per_pixel);
 
   /* create sourcebuffer from testbuffer in the correct format */
   babl_process (fish_rgba_to_source,
-                test, source, test_pixels);
+                test, source, num_test_pixels);
 
   /* calculate the reference buffer of how it should be */
   babl_process (fish_reference,
-                source, ref_destination, test_pixels);
+                source, ref_destination, num_test_pixels);
 
   /* calculate this chains view of what the result should be */
-  chain_process (chain, conversions, source, destination, test_pixels);
+  chain_process (chain, conversions, source, destination, num_test_pixels);
 
   /* transform the reference and the actual destination buffers to RGBA
    * for comparison with each other
    */
   babl_process (fish_destination_to_rgba,
-                ref_destination, ref_destination_rgba_double, test_pixels);
+                ref_destination, ref_destination_rgba_double, num_test_pixels);
   babl_process (fish_destination_to_rgba,
-                destination, destination_rgba_double, test_pixels);
+                destination, destination_rgba_double, num_test_pixels);
 
   error = babl_rel_avg_error (destination_rgba_double,
                               ref_destination_rgba_double,
-                              test_pixels * 4);
+                              num_test_pixels * 4);
 
   fish_rgba_to_source->fish.processings--;
   fish_reference->fish.processings--;
   fish_destination_to_rgba->fish.processings -= 2;
 
-  fish_rgba_to_source->fish.pixels      -= test_pixels;
-  fish_reference->fish.pixels           -= test_pixels;
-  fish_destination_to_rgba->fish.pixels -= 2 * test_pixels;
+  fish_rgba_to_source->fish.pixels      -= num_test_pixels;
+  fish_reference->fish.pixels           -= num_test_pixels;
+  fish_destination_to_rgba->fish.pixels -= 2 * num_test_pixels;
 
   babl_free (source);
   babl_free (destination);